import * as echarts from "echarts";
// 柱状图
export const pillarOption = {
  grid: {
    top: "10px",
    left: "0",
    right: "0",
    bottom: "14px",
    containLabel: true,
  },
  xAxis: {
    type: "category",
    data: [],
  },
  yAxis: {
    type: "value",
  },
  series: [
    {
      itemStyle: {
        normal: {
          //显示渐变色颜色
          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
            { offset: 0, color: "rgba(0, 224, 203, 1)" },
            { offset: 1, color: "rgba(91, 143, 249, 0.20)" },
          ]),
        },
      },
      data: [],
      type: "bar",
    },
  ],
};
// 饼图
export const pieOption = {
  series: [
    {
      name: "Access From",
      type: "pie",
      radius: ["50%", "80%"],
      avoidLabelOverlap: false,
      label: {
        show: false,
        position: "center",
      },

      emphasis: {
        label: {
          show: true,
          fontSize: 12,
          fontWeight: "bold",
          formatter: `{c}\n{b}`,
          color: () => {},
          lineHeight: 20,
        },
      },
      labelLine: {
        show: false,
      },
      data: [
        // { value: 1048, name: '违规闯入' },
        // { value: 735, name: '反光衣' },
        // { value: 580, name: '安全帽' },
        // { value: 484, name: '人员下车' },
      ],
    },
  ],
};
// 折线图
export const categoryOptions = {
  tooltip: {
    show: true,
    // trigger: "axis",
  },
  grid: {
    top: "20px",
    left: "14px",
    right: "14px",
    bottom: "0px",
    containLabel: true,
  },
  xAxis: {
    position: "right",
    boundaryGap: false,
    // axisTick: {
    //   show: false, // 隐藏x轴刻度线
    // },
    splitLine: {
      // 分割线
      lineStyle: {
        color: "red",
      },
    },
    axisLine: {
      show: true,
      lineStyle: {
        // color: "#ff0000", // 将此处替换为你想要的颜色，例如红色
      },
    },
    type: "category",
    data: [
      "0:00",
      "2:00",
      "4:00",
      "6:00",
      "8:00",
      "10:00",
      "12:00",
      "14:00",
      "16:00",
      "20:00",
      "22:00",
      "24:00",
    ],
  },
  yAxis: {
    scale: true,
    boundaryGap: true,
    axisTick: {
      show: false, // 隐藏x轴刻度线
    },
    axisLine: {
      show: false, // 隐藏Y轴实线
    },

    splitLine: {
      lineStyle: {
        color: "#cccccc78",
      },
    },
    type: "value",
    // eslint-disable-next-line no-dupe-keys
    boundaryGap: false,
    // data: [0, 20, 40, 60, 80, 100]
  },
  series: [
    {
      name: "today",
      //   symbol: "none",
      data: [],
      type: "line",
      lineStyle: {
        // 设置线条的style等
        normal: {
          color: "#1890ff", // 折线线条颜色:红色
        },
      },
    },
    {
      name: "yestoday",
      //   symbol: "none",
      data: [],
      type: "line",
      lineStyle: {
        // 设置线条的style等
        normal: {
          color: "#99ccff", // 折线线条颜色:红色
        },
      },
    },
  ],
};
